package com.eedi.framework.mail.dal.mapper;

import com.eedi.framework.common.pojo.PageResult;
import com.eedi.framework.mail.controller.sys.vo.account.MailAccountPageReq;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.framework.mail.dal.dataobject.SysMailAccountDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SysMailAccountMapper extends BaseMapperX<SysMailAccountDO> {

    default PageResult<SysMailAccountDO> selectPage(MailAccountPageReq pageReqVO) {
        return selectPage(pageReqVO, new LambdaQueryWrapperX<SysMailAccountDO>()
                .likeIfPresent(SysMailAccountDO::getMail, pageReqVO.getMail())
                .likeIfPresent(SysMailAccountDO::getUsername , pageReqVO.getUsername()));
    }

}
